package com.cyh.testdesignpattern.factory.factorymethod.order;

import com.cyh.testdesignpattern.factory.factorymethod.pizza.LdCheesePizza;
import com.cyh.testdesignpattern.factory.factorymethod.pizza.LdGreePizza;
import com.cyh.testdesignpattern.factory.factorymethod.pizza.Pizza;

public class LdOrderPizza extends OrderPizza {
    public LdOrderPizza(String orderType) {
        super(orderType);
    }

    @Override
    Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if(orderType.equals("cheese")) {
            pizza = new LdCheesePizza();
        } else if(orderType.equals("gree")) {
            pizza = new LdGreePizza();
        }
        return pizza;
    }
}
